Function.prototype.mybind = function (thisArg, ...args) {
  if (thisArg === null || undefined) {
    thisArg = window || globalThis
  }
  if (typeof this !== 'function') {
    throw new TypeError('error')
  }

  return (...rest) => {
    this.call(thisArg, ...args, ...rest)
  }
}
// 测试
const o = {
  name: '白雨杰',
  age: 1
}
function say(job, address, like) {
  console.log(this.name, this.age, job, address, like)
}
say.mybind(o, '前端', '北京')('玩')
